package com.gilight.base.admin.product;

import com.gilight.base.base.exception.ServiceException;
import com.gilight.base.dto.goods.AdminSpuDTO;
import com.gilight.base.dto.goods.SpuDTO;
import com.gilight.base.dto.goods.SpuTreeNodeDTO;
import com.gilight.base.model.Page;
import java.util.List;

/**管理员商品服务
 *
 */
public interface AdminProductService {
    /**
     * 获取SPU树
     * @param adminId  管理员Id
     * @returngetSpuBigTreeColdDrind
     * @throws ServiceException
     */
    public List<SpuTreeNodeDTO> getSpuBigTree(
            Long adminId) throws ServiceException;
    /**
     * 获取SPU树
     * @param adminId  管理员Id
     * @return
     * @throws ServiceException
     */
    public List<SpuTreeNodeDTO> getSpuBigTreeColdDrind(
            Long adminId,Long zId) throws ServiceException;
    /**
     * 创建
     * @param spuDTO    商品JSON数据
     * @param adminId   管理员ID
     * @return
     * @throws ServiceException
     */
    public String create(
            AdminSpuDTO spuDTO,
            Long adminId,
            Integer isBaiHuo) throws ServiceException;

    /**
     *                        编辑
     * @param spuDTO          商品JSON数据
     * @param adminId        管理员ID
     * @return
     * @throws ServiceException
     */
    public String edit(
            AdminSpuDTO spuDTO,
            Long adminId) throws ServiceException;

    /**
     * 列表
     * @param page  页码 1
     * @param limit 页码长度 20
     * @param categoryId 搜索分类
     * @param title      搜索标题
     * @param barcode    商品条形码
     * @param status     商品状态
     * @param adminId    管理员Id
     * @return
     * @throws ServiceException
     */
    public Page<SpuDTO> list(
            Integer page,
            Integer limit,
            Long categoryId,
            String title,
            String barcode,
            Integer status,
            Long zzjgId,
            Long adminId) throws ServiceException;

    /**
     *                        详情
     * @param spuId           商品Id
     * @param adminId         管理员Id
     * @return
     * @throws ServiceException
     */
    public AdminSpuDTO detail(
            Long spuId,
            Long adminId,
            Integer isBaiHuo) throws ServiceException;
    /**
     *   上下架
     * @param spuId        商品Id
     * @param status       商品想要变为的状态
     * @param adminId      管理员Id
     * @return
     * @throws ServiceException
     */
    public AdminSpuDTO freezeOrActivation(
            Long spuId,
            Integer status,
            Long adminId) throws ServiceException;

    /**
     * 删除
     * @param spuId          商品Id
     * @param adminId        管理员Id
     * @return
     * @throws ServiceException
     */
    public String delete(
            Long spuId,
            Long adminId) throws ServiceException;

    /**
     * 批量删除
     * @param ids      商品Id集合
     * @param adminId  管理员Id
     * @return
     * @throws ServiceException
     */
    public String batchDelete(
            String ids,
            Long adminId) throws ServiceException;

    /**
     * 重建商品缓存
     * @param adminId  管理员Id
     * @return
     * @throws ServiceException
     */
    public String rebuildProductCache(
            Long adminId) throws ServiceException;

    Object limitSpu(Long spuId,Integer num);
}
